import {
	Block1,
	Block2,
	Block3,
	Block4,
	Block5,
	Block6,
	Block7
} from './block.js';

function blockFactory(index, dir){
	index = index + 1;
	let b = '';
	switch(index){
		case 1:
			b = new Block1();
			break;
		case 2:
			b = new Block2();
			break;
		case 3:
			b = new Block3();
			break;
		case 4:
			b = new Block4();
			break;
		case 5:
			b = new Block5();
			break;
		case 6:
			b = new Block6();
			break;
		case 7:
			b = new Block7();
			break;
		default: break;
	}
	b.origin.x = 0;
	b.origin.y = 4;
	b.rotate(dir);
	return b;
}

//导出模块
export {blockFactory};